﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="SugLog.aspx.cs" Inherits="NuaTarDoneng.SugLog" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        DeleteCommand="DELETE FROM [SugInfo] WHERE [sugid] = @sugid" 
        InsertCommand="INSERT INTO [SugInfo] ([sugid], [deviceid], [info], [time], [IsRead]) VALUES (@sugid, @deviceid, @info, @time, @IsRead)" 
        SelectCommand="SELECT * FROM [SugInfo]" 
        
        UpdateCommand="UPDATE [SugInfo] SET [deviceid] = @deviceid, [info] = @info, [time] = @time, [IsRead] = @IsRead WHERE [sugid] = @sugid">
        <DeleteParameters>
            <asp:Parameter Name="sugid" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="sugid" Type="String" />
            <asp:Parameter Name="deviceid" Type="String" />
            <asp:Parameter Name="info" Type="String" />
            <asp:Parameter Name="time" Type="Int32" />
            <asp:Parameter Name="IsRead" Type="Int32" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="deviceid" Type="String" />
            <asp:Parameter Name="info" Type="String" />
            <asp:Parameter Name="time" Type="Int32" />
            <asp:Parameter Name="IsRead" Type="Int32" />
            <asp:Parameter Name="sugid" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Width="100%" 
        CellPadding="4" ForeColor="#333333" GridLines="None" DataKeyNames="sugid">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="sugid" HeaderText="sugid" ReadOnly="True" 
                SortExpression="sugid" />
            <asp:BoundField DataField="deviceid" HeaderText="deviceid" 
                SortExpression="deviceid" />
            <asp:BoundField DataField="info" HeaderText="info" SortExpression="info" />
            <asp:BoundField DataField="time" HeaderText="time" SortExpression="time" />
            <asp:BoundField DataField="IsRead" HeaderText="IsRead" 
                SortExpression="IsRead" />
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
    
</asp:Content>
